/**
 * 影刺客装备配置
 * 展示敏捷型职业的装备配置模式
 */

import { EquipmentTemplate, ConfigCollection } from '../types/ConfigTypes';

/**
 * 影刺客武器配置
 */
export const shadowAssassinWeapons: EquipmentTemplate[] = [
    {
        id: "shadow_assassin_dagger_001",
        name: "影刃",
        sys: "暗影本质",
        type: "刺客",
        job: "影刺客",
        solt: "武器",
        icon: "dagger_shadow",
        emoji: "🗡️",
        desc: "由暗影精华锻造的匕首，攻击时无声无息",
        source: "暗影神殿",
        
        quality: {
            min: 2, // 绿色起步
            max: 5, // 最高橙色
            weights: [35, 35, 25, 5] // 各品质权重分布（对应品质2,3,4,5）
        },
        
        baseAttributes: [
            {
                key: "物理攻击",
                min: 20,
                max: 35,
                growthType: "linear",
                qualityMultiplier: 1.3
            },
            {
                key: "暴击率",
                min: 8,
                max: 15,
                growthType: "exponential",
                qualityMultiplier: 1.1
            },
            {
                key: "攻击速度",
                min: 10,
                max: 20,
                growthType: "linear"
            }
        ],
        
        skillPools: {
            inherent: [
                {
                    skillId: "SHADOW_STRIKE",
                    reName: "影袭",
                    desc: "对目标造成物理伤害，有概率触发暴击",
                    maxLevel: 10,
                    type: "active"
                }
            ],
            
            enchantable: [
                {
                    skill: {
                        skillId: "STEALTH",
                        reName: "潜行",
                        desc: "进入隐身状态，下次攻击伤害翻倍",
                        maxLevel: 5,
                        type: "active"
                    },
                    weight: 100,
                    maxCount: 1
                },
                {
                    skill: {
                        skillId: "POISON_BLADE",
                        reName: "毒刃",
                        desc: "攻击时附加中毒效果",
                        maxLevel: 8,
                        type: "passive"
                    },
                    weight: 80,
                    conditions: {
                        minLevel: 3
                    }
                }
            ]
        },
        
        enabled: true,
        tags: ["暗影", "刺客", "武器", "暴击"]
    }
];

/**
 * 影刺客护甲配置
 */
export const shadowAssassinArmors: EquipmentTemplate[] = [
    {
        id: "shadow_assassin_cloak_001",
        name: "影之斗篷",
        sys: "暗影本质",
        type: "刺客",
        job: "影刺客",
        solt: "护甲",
        icon: "cloak_shadow",
        emoji: "👘",
        desc: "由暗影丝线编织的斗篷，提供隐蔽和防护",
        source: "暗影神殿",
        
        quality: {
            min: 2,
            max: 5,
            weights: [40, 30, 20, 10] // 对应品质2,3,4,5
        },
        
        baseAttributes: [
            {
                key: "物理防御",
                min: 15,
                max: 25,
                growthType: "linear",
                qualityMultiplier: 1.2
            },
            {
                key: "魔法防御",
                min: 10,
                max: 20,
                growthType: "linear"
            },
            {
                key: "闪避率",
                min: 5,
                max: 12,
                growthType: "exponential"
            }
        ],
        
        skillPools: {
            inherent: [
                {
                    skillId: "SHADOW_CLOAK",
                    reName: "影之庇护",
                    desc: "受到攻击时有概率进入短暂隐身状态",
                    maxLevel: 8,
                    type: "passive"
                }
            ],
            
            enchantable: [
                {
                    skill: {
                        skillId: "NIGHT_VISION",
                        reName: "夜视",
                        desc: "在黑暗中视野不受影响",
                        maxLevel: 5,
                        type: "passive"
                    },
                    weight: 60
                }
            ]
        },
        
        enabled: true,
        tags: ["暗影", "刺客", "护甲", "闪避"]
    }
];

/**
 * 影刺客装备配置集合
 */
export const ShadowAssassinEquipmentCollection: ConfigCollection<EquipmentTemplate> = {
    version: "1.0.0",
    lastUpdated: Date.now(),
    data: [...shadowAssassinWeapons, ...shadowAssassinArmors],
    metadata: {
        author: "Game Design Team",
        description: "影刺客职业装备配置，专注敏捷和隐蔽",
        changelog: [
            "1.0.0 - 初始版本，包含基础武器和护甲配置"
        ]
    }
};

// 导出便于其他模块使用的查询函数
export const ShadowAssassinEquipmentHelper = {
    getWeapons: () => shadowAssassinWeapons,
    getArmors: () => shadowAssassinArmors,
    getByQuality: (minQuality: number, maxQuality: number) => 
        [...shadowAssassinWeapons, ...shadowAssassinArmors].filter(eq => 
            eq.quality.min <= maxQuality && eq.quality.max >= minQuality
        )
};
